package com.witmore.neutron.ai.web.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jk.common.response.ResponseResult;
import com.witmore.neutron.ai.db.entity.AgentSessionRecordDO;
import com.witmore.neutron.ai.db.entity.AgentSessionRecordDetailDO;
import com.witmore.neutron.ai.web.controller.vo.ChatRecordQuery;
import com.witmore.neutron.ai.web.service.SessionRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description: ChatSessionRecordController
 * Author: 豆子高
 * Date: 2025/6/9 10:02
 */
@RestController
@RequestMapping("/session/record/")
public class ChatSessionRecordController {

    @Autowired
    private SessionRecordService sessionRecordService;

    @GetMapping("list")
    public ResponseResult<Page<AgentSessionRecordDO>> list(ChatRecordQuery query) {
        Page<AgentSessionRecordDO> recordListPage = sessionRecordService.getRecordListPage(query);
        return ResponseResult.success(recordListPage);
    }

    @GetMapping("detail")
    public ResponseResult<Page<AgentSessionRecordDetailDO>> detail(ChatRecordQuery query) {
        Page<AgentSessionRecordDetailDO> sessionRecordDetailDOPage = sessionRecordService.getRecordDetailListPage(query);
        return ResponseResult.success(sessionRecordDetailDOPage);
    }

}
